<?php

namespace app\merchants\validate;

use yiqiniu\extend\validate\YqnValidate;

class RechargeValid extends YqnValidate
{

    /**
     * 当前验证规则
     * @var array
     */
    protected $rule = [
        'pay_way' => 'require|in:1,2,3',
        'pay_money' => 'require|gt:0',
        'package_id' => 'require',
    ];

    /**
     * 验证提示信息
     * @var array
     */
    protected $message = [
        'pay_way.require' => '充值方式不能为空',
        'pay_way.in' => '充值方式不正确',
        'pay_money.require' => '充值金额不能为空',
        'pay_money.gt' => '充值金额必须大于0',
        'package_id.require' => '套餐编号不能为空',
    ];

    protected $scene = [
        // 充值
        'balance' => ['pay_way', 'pay_money'],
        // 购习虚码
        'buy_virtual' => ['package_id'],
    ];

}